package com.genexususa.eo.bing.data.wsSubclasses;

import com.genexususa.eo.bing.CampaignManagementServiceClasses.CountryTarget;
import com.genexususa.eo.bing.CampaignManagementServiceClasses.CountryTargetBid;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class GxCountryTarget extends CountryTarget {
    public GxCountryTarget(Element element) {
        NodeList bidsNode = element.getElementsByTagName("CountryTargetBidCollection");
        if (bidsNode.getLength() > 0) {
            NodeList countryTargetBidNode = ((Element)bidsNode.item(0)).getElementsByTagName("CountryTargetBid");
            CountryTargetBid[] countryTargetBids = new CountryTargetBid[countryTargetBidNode.getLength()];
            for (int temp = 0; temp < countryTargetBidNode.getLength(); temp++) {
                countryTargetBids[temp] = new GxCountryTargetBid((Element)countryTargetBidNode.item(temp));
            }
            this.setBids(countryTargetBids);
        }
    }
}
